package com.ruoyi.base.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.uuid.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.base.mapper.BaseBasinMapper;
import com.ruoyi.base.domain.BaseBasin;
import com.ruoyi.base.service.IBaseBasinService;

/**
 * 流域Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-27
 */
@Service
public class BaseBasinServiceImpl implements IBaseBasinService 
{
    @Autowired
    private BaseBasinMapper baseBasinMapper;

    /**
     * 查询流域
     * 
     * @param ID 流域主键
     * @return 流域
     */
    @Override
    public BaseBasin selectBaseBasinByID(String ID)
    {
        return baseBasinMapper.selectBaseBasinByID(ID);
    }

    /**
     * 查询流域列表
     * 
     * @param baseBasin 流域
     * @return 流域
     */
    @Override
    public List<BaseBasin> selectBaseBasinList(BaseBasin baseBasin)
    {
        return baseBasinMapper.selectBaseBasinList(baseBasin);
    }

    /**
     * 新增流域
     * 
     * @param baseBasin 流域
     * @return 结果
     */
    @Override
    public int insertBaseBasin(BaseBasin baseBasin)
    {
        baseBasin.setId(UUID.randomUUID().toString());
        baseBasin.setUpdatetime(new Date());
        return baseBasinMapper.insertBaseBasin(baseBasin);
    }

    /**
     * 修改流域
     * 
     * @param baseBasin 流域
     * @return 结果
     */
    @Override
    public int updateBaseBasin(BaseBasin baseBasin)
    {
        baseBasin.setUpdatetime(new Date());
        return baseBasinMapper.updateBaseBasin(baseBasin);
    }

    /**
     * 批量删除流域
     * 
     * @param IDs 需要删除的流域主键
     * @return 结果
     */
    @Override
    public int deleteBaseBasinByIDs(String[] IDs)
    {
        return baseBasinMapper.deleteBaseBasinByIDs(IDs);
    }

    /**
     * 删除流域信息
     * 
     * @param ID 流域主键
     * @return 结果
     */
    @Override
    public int deleteBaseBasinByID(String ID)
    {
        return baseBasinMapper.deleteBaseBasinByID(ID);
    }
}
